<?php


namespace app\common\behavior;

class Cors
{
    public function appInit(&$params)
    {
        header('Access-Control-Allow-Origin: *');
        header("Access-Control-Allow-Headers: token,Origin, X-Requested-With, Content-Type, Accept, Authorization");
        header('Access-Control-Allow-Methods: POST,GET,PUT,DELETE,OPTIONS');
        if(request()->isOptions()){
            exit();
        }
    }
}